Micron Document
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
| SparkN0de-git | SparkN0de |
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------


Commit 734305e9c7a0d20b68ab35000db46200131a6f6e


Parents : ad773dc
Author : Mark Qvist <mark@unsigned.io>
Date : 2021-10-02T23:30:38+02:00

General structure for LXMF propagation

Changes

1 files changed, 8 insertions(+), 2 deletions(-)

M LXMF/LXMF.py +8 -2

Diff

diff --git a/LXMF/LXMF.py b/LXMF/LXMF.py
index 75b77e9..9002b7e 100644
--- a/LXMF/LXMF.py
+++ b/LXMF/LXMF.py
@@ -499,7 +499,7 @@ class LXMFPropagationAnnounceHandler:
class LXMPeer:
- OFFER_REQUEST_PATH = "o"
+ OFFER_REQUEST_PATH = "/offer"
IDLE = 0x00
LINK_ESTABLISHING = 0x01
@@ -861,7 +861,13 @@ class LXMRouter:
# TODO: The peer this was received from should
# have the transient id added to it's list of
# already handled messages.
- self.lxmf_propagation(resource.data.read())
+ try:
+ messages = msgpack.unpackb(resource.data.read())
+ for message in messages:
+ self.lxmf_propagation(lxmessage)
+
+ except Exception as e:
+ RNS.log("Error while unpacking received propagation messages", RNS.LOG_DEBUG)
def lxmf_propagation(self, lxmf_data):


──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────